<?php
/**

 //  The DoYouHaoBaby PHP FrameWork - trace
 //  +---------------------------------------------------------------------
 //
 //  “Copyright”
 //  +---------------------------------------------------------------------
 //	 | (C) 2010 - 2011 http://doyouhaobaby.net All rights reserved.
 //	 | This is not a free software, use is subject to license terms
 //  +---------------------------------------------------------------------
 //
 //  “About This File”
 //  +---------------------------------------------------------------------
 //	 | trace Index控制器
 //  +---------------------------------------------------------------------

*/

!defined('DYHB_PATH') && exit;

class IndexController extends Controller{


	/**
	 * 首页 < 默认访问 >
	 *
	 * @access public
	 * @return void
	 */
    public function index(){

		$oModel = FormModel::F();

        // 随便进行几个查询，来显示页面的SQL查询记录
        $arrResult1 = $oModel->setColumns( 'form_id,form_title' )
			                 ->order('`form_id` DESC')
			                 ->limit( 0,6 )
			                 ->asArray()
			                 ->query( ); 

        // 开始捕获错误
		if( $oModel->isError() )
		     $this->E(  $oModel->getErrorMessage() );

        $arrResult2  = $oModel->top( 2 )
			           ->asArray()
			           ->query(); 

		// 开始捕获错误
		if( $oModel->isError() )
		     $this->E(  $oModel->getErrorMessage() );

        $arrResult3 = $oModel->setColumns('form_id,form_title')
			                 ->order('`form_id` DESC')
			                 ->limit(3)
			                 ->asArray()
			                 ->query(); 

		// 开始捕获错误
		if( $oModel->isError() )
		     $this->E(  $oModel->getErrorMessage() );

        // 增加自己的调试Trace信息
        $this->T( '调试数据1',G::dump( $arrResult1,false) ); 
		$this->T( '调试数据2',G::dump( $arrResult2,false) ); 
		$this->T( '调试数据3',G::dump( $arrResult3,false) ); 
        $this->T( 'Cookie信息',G::dump($_COOKIE,false) ); 
        $this->display( );

    }

}
